home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / AppleTalk.h < prev    next >
Text File  |  1991-04-17  |  28KB  |  764 lines

  1. /************************************************************
  2.  
  3. Created: Friday, March 22, 1991 at 5:51 PM
  4.     AppleTalk.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc. 1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __APPLETALK__
  15. #define __APPLETALK__
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. #endif
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.  
  29. /*    Driver unit and reference numbers (ADSP is dynamic)*/
  30.  
  31.     mppUnitNum = 9,                 /*MPP unit number*/
  32.     atpUnitNum = 10,                /* ATP unit number */
  33.     xppUnitNum = 40,                /* XPP unit number */
  34.     mppRefNum = -10,                /*MPP reference number */
  35.     atpRefNum = -11,                /* ATP reference number */
  36.     xppRefNum = -41,                /* XPP reference number */
  37.  
  38. /*    .MPP csCodes*/
  39.  
  40.     lookupReply = 242,              /* This command queued to ourself */
  41.     writeLAP = 243,                 /* Write out LAP packet */
  42.     detachPH = 244,                 /* Detach LAP protocol handler */
  43.     attachPH = 245,                 /* Attach LAP protocol handler */
  44.     writeDDP = 246,                 /* Write out DDP packet */
  45.     closeSkt = 247,                 /* Close DDP socket */
  46.     openSkt = 248,                  /* Open DDP socket */
  47.     loadNBP = 249,                  /* Load NBP command-executing code */
  48.     lastResident = 249,             /* Last resident command */
  49.     confirmName = 250,              /* Confirm name */
  50.     lookupName = 251,               /* Look up name on internet */
  51.     removeName = 252,               /* Remove name from Names Table */
  52.     registerName = 253,             /* Register name in Names Table */
  53.     killNBP = 254                   /* Kill outstanding NBP request */
  54. };
  55. enum {
  56.     unloadNBP = 255,                /* Unload NBP command code */
  57.     setSelfSend = 256,              /* MPP: Set to allow writes to self */
  58.     SetMyZone = 257,                /* Set my zone name */
  59.     GetATalkInfo = 258,             /* get AppleTalk information */
  60.     ATalkClosePrep = 259,           /* AppleTalk close query */
  61.  
  62. /*    .ATP csCodes*/
  63.  
  64.     nSendRequest = 248,             /* NSendRequest code */
  65.     relRspCB = 249,                 /* Release RspCB */
  66.     closeATPSkt = 250,              /* Close ATP socket */
  67.     addResponse = 251,              /* Add response code | Require open skt */
  68.     sendResponse = 252,             /* Send response code */
  69.     getRequest = 253,               /* Get request code */
  70.     openATPSkt = 254,               /* Open ATP socket */
  71.     sendRequest = 255,              /* Send request code */
  72.     relTCB = 256,                   /* Release TCB */
  73.     killGetReq = 257,               /* Kill GetRequest */
  74.     killSendReq = 258,              /* Kill SendRequest */
  75.     killAllGetReq = 259,            /* Kill all getRequests for a skt */
  76.  
  77. /*    .XPP csCodes*/
  78.  
  79.     openSess = 255,                 /* Open session */
  80.     closeSess = 254,                /* Close session */
  81.     userCommand = 253               /* User command */
  82. };
  83. enum {
  84.     userWrite = 252,                /* User write */
  85.     getStatus = 251,                /* Get status */
  86.     afpCall = 250,                  /* AFP command (buffer has command code) */
  87.     getParms = 249,                 /* Get parameters */
  88.     abortOS = 248,                  /* Abort open session request */
  89.     closeAll = 247,                 /* Close all open sessions */
  90.     xCall = 246,                    /* .XPP extended calls */
  91.     ATTransOpen = 0,                /*AppleTalk has opened*/
  92.     ATTransClose = 2,               /*AppleTalk is about to close*/
  93.     ATTransClosePrep = 3,           /*Is it OK to close AppleTalk ?*/
  94.     ATTransCancelClose = 4,         /*Cancel the ClosePrep transition*/
  95.     afpByteRangeLock = 1,           /*AFPCall command codes*/
  96.     afpVolClose = 2,                /*AFPCall command codes*/
  97.     afpDirClose = 3,                /*AFPCall command codes*/
  98.     afpForkClose = 4,               /*AFPCall command codes*/
  99.     afpCopyFile = 5,                /*AFPCall command codes*/
  100.     afpDirCreate = 6,               /*AFPCall command codes*/
  101.     afpFileCreate = 7,              /*AFPCall command codes*/
  102.     afpDelete = 8,                  /*AFPCall command codes*/
  103.     afpEnumerate = 9                /*AFPCall command codes*/
  104. };
  105. enum {
  106.     afpFlush = 10,                  /*AFPCall command codes*/
  107.     afpForkFlush = 11,              /*AFPCall command codes*/
  108.     afpGetDirParms = 12,            /*AFPCall command codes*/
  109.     afpGetFileParms = 13,           /*AFPCall command codes*/
  110.     afpGetForkParms = 14,           /*AFPCall command codes*/
  111.     afpGetSInfo = 15,               /*AFPCall command codes*/
  112.     afpGetSParms = 16,              /*AFPCall command codes*/
  113.     afpGetVolParms = 17,            /*AFPCall command codes*/
  114.     afpLogin = 18,                  /*AFPCall command codes*/
  115.     afpContLogin = 19,              /*AFPCall command codes*/
  116.     afpLogout = 20,                 /*AFPCall command codes*/
  117.     afpMapID = 21,                  /*AFPCall command codes*/
  118.     afpMapName = 22,                /*AFPCall command codes*/
  119.     afpMove = 23,                   /*AFPCall command codes*/
  120.     afpOpenVol = 24,                /*AFPCall command codes*/
  121.     afpOpenDir = 25,                /*AFPCall command codes*/
  122.     afpOpenFork = 26,               /*AFPCall command codes*/
  123.     afpRead = 27,                   /*AFPCall command codes*/
  124.     afpRename = 28,                 /*AFPCall command codes*/
  125.     afpSetDirParms = 29             /*AFPCall command codes*/
  126. };
  127. enum {
  128.     afpSetFileParms = 30,           /*AFPCall command codes*/
  129.     afpSetForkParms = 31,           /*AFPCall command codes*/
  130.     afpSetVolParms = 32,            /*AFPCall command codes*/
  131.     afpWrite = 33,                  /*AFPCall command codes*/
  132.     afpGetFlDrParms = 34,           /*AFPCall command codes*/
  133.     afpSetFlDrParms = 35,           /*AFPCall command codes*/
  134.     afpDTOpen = 48,                 /*AFPCall command codes*/
  135.     afpDTClose = 49,                /*AFPCall command codes*/
  136.     afpGetIcon = 51,                /*AFPCall command codes*/
  137.     afpGtIcnInfo = 52,              /*AFPCall command codes*/
  138.     afpAddAPPL = 53,                /*AFPCall command codes*/
  139.     afpRmvAPPL = 54,                /*AFPCall command codes*/
  140.     afpGetAPPL = 55,                /*AFPCall command codes*/
  141.     afpAddCmt = 56,                 /*AFPCall command codes*/
  142.     afpRmvCmt = 57,                 /*AFPCall command codes*/
  143.     afpGetCmt = 58,                 /*AFPCall command codes*/
  144.     afpAddIcon = 192,               /*Special code for ASP Write commands*/
  145.  
  146.     xppLoadedBit = 5,               /* XPP bit in PortBUse */
  147.     scbMemSize = 192,               /*Size of memory for SCB */
  148.     xppFlagClr = 0                  /*Cs for AFPCommandBlock */
  149. };
  150. enum {
  151.     xppFlagSet = 128,               /*StartEndFlag & NewLineFlag fields. */
  152.  
  153.     lapSize = 20,
  154.     ddpSize = 26,
  155.     nbpSize = 26,
  156.     atpSize = 56,
  157.  
  158. #define MPPioCompletion MPP.ioCompletion
  159. #define MPPioResult MPP.ioResult
  160. #define MPPioRefNum MPP.ioRefNum
  161. #define MPPcsCode MPP.csCode
  162. #define LAPprotType LAP.protType
  163. #define LAPwdsPointer LAP.LAPptrs.wdsPointer
  164. #define LAPhandler LAP.LAPptrs.handler
  165. #define DDPsocket DDP.socket
  166. #define DDPchecksumFlag DDP.checksumFlag
  167. #define DDPwdsPointer DDP.DDPptrs.wdsPointer
  168. #define DDPlistener DDP.DDPptrs.listener
  169. #define NBPinterval NBP.interval
  170. #define NBPcount NBP.count
  171. #define NBPntQElPtr NBP.NBPPtrs.ntQElPtr
  172. #define NBPentityPtr NBP.NBPPtrs.entityPtr
  173. #define NBPverifyFlag NBP.parm.verifyFlag
  174. #define NBPretBuffPtr NBP.parm.Lookup.retBuffPtr
  175. #define NBPretBuffSize NBP.parm.Lookup.retBuffSize
  176. #define NBPmaxToGet NBP.parm.Lookup.maxToGet
  177. #define NBPnumGotten NBP.parm.Lookup.numGotten
  178. #define NBPconfirmAddr NBP.parm.Confirm.confirmAddr
  179. #define NBPnKillQEl NBPKILL.nKillQEl
  180. #define NBPnewSocket NBP.parm.Confirm.newSocket
  181. #define ATPioCompletion ATP.ioCompletion
  182. #define ATPioResult ATP.ioResult
  183. #define ATPuserData ATP.userData
  184. #define ATPreqTID ATP.reqTID
  185. #define ATPioRefNum ATP.ioRefNum
  186. #define ATPcsCode ATP.csCode
  187. #define ATPatpSocket ATP.atpSocket
  188. #define ATPatpFlags ATP.atpFlags
  189. #define ATPaddrBlock ATP.addrBlock
  190. #define ATPreqLength ATP.reqLength
  191. #define ATPreqPointer ATP.reqPointer
  192. #define ATPbdsPointer ATP.bdsPointer
  193. #define ATPtimeOutVal SREQ.timeOutVal
  194. #define ATPnumOfResps SREQ.numOfResps
  195. #define ATPretryCount SREQ.retryCount
  196. #define ATPnumOfBuffs OTH1.u0.numOfBuffs
  197. #define ATPbitMap OTH1.u0.bitMap
  198. #define ATPrspNum OTH1.u0.rspNum
  199. #define ATPbdsSize OTH2.bdsSize
  200. #define ATPtransID OTH2.transID
  201. #define ATPaKillQEl KILL.aKillQEl
  202.  
  203.     atpXOvalue = 32,                /*ATP exactly-once bit */
  204.     atpEOMvalue = 16,               /*ATP End-Of-Message bit */
  205.     atpSTSvalue = 8,                /*ATP Send-Transmission-Status bit */
  206.     atpTIDValidvalue = 2,           /*ATP trans. ID valid bit */
  207.     atpSendChkvalue = 1,            /*ATP send checksum bit */
  208.     zipGetLocalZones = 5,
  209.     zipGetZoneList = 6,
  210.     zipGetMyZone = 7,
  211.     LAPMgrPtr = 0xB18,              /*Entry point for LAP Manager*/
  212.     LAPMgrCall = 2,                 /*Offset to LAP routines*/
  213.     LAddAEQ = 23,                   /*LAPAddATQ routine selector*/
  214.     LRmvAEQ = 24                    /*LAPRmvATQ routine selector*/
  215. };
  216.  
  217. enum {tLAPRead,tLAPWrite,tDDPRead,tDDPWrite,tNBPLookup,tNBPConfirm,tNBPRegister,
  218.     tATPSndRequest,tATPGetRequest,tATPSdRsp,tATPAddRsp,tATPRequest,tATPResponse};
  219. typedef unsigned char ABCallType;
  220.  
  221. enum {lapProto,ddpProto,nbpProto,atpProto};
  222. typedef unsigned char ABProtoType;
  223.  
  224.  
  225. typedef Byte ABByte;
  226.  
  227.  
  228. struct LAPAdrBlock {
  229.     unsigned char dstNodeID;
  230.     unsigned char srcNodeID;
  231.     ABByte lapProtType;
  232. };
  233.  
  234. typedef struct LAPAdrBlock LAPAdrBlock;
  235.  
  236. struct ATQEntry {
  237.     struct ATQEntry *qLink;         /*next queue entry*/
  238.     short qType;                    /*queue type*/
  239.     ProcPtr CallAddr;               /*pointer to your routine*/
  240. };
  241.  
  242. typedef struct ATQEntry ATQEntry;
  243. typedef ATQEntry *ATQEntryPtr;
  244.  
  245. struct AddrBlock {
  246.     short aNet;
  247.     unsigned char aNode;
  248.     unsigned char aSocket;
  249. };
  250.  
  251. typedef struct AddrBlock AddrBlock;
  252.  
  253. /* Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  254. offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  255. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  256. only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  257. be the same, which is OK since they are not used. */
  258. struct EntityName {
  259.     Str32 objStr;
  260.     char pad1;                      /*Str32's aligned on even word boundries.*/
  261.     Str32 typeStr;
  262.     char pad2;
  263.     Str32 zoneStr;
  264.     char pad3;
  265. };
  266.  
  267. typedef struct EntityName EntityName;
  268. typedef EntityName *EntityPtr;
  269.  
  270. struct RetransType {
  271.     unsigned char retransInterval;
  272.     unsigned char retransCount;
  273. };
  274.  
  275. typedef struct RetransType RetransType;
  276.  
  277. struct BDSElement {
  278.     short buffSize;
  279.     Ptr buffPtr;
  280.     short dataSize;
  281.     long userBytes;
  282. };
  283.  
  284. typedef struct BDSElement BDSElement;
  285.  
  286.  
  287. typedef BDSElement BDSType[8];
  288. typedef BDSType *BDSPtr;
  289. typedef char BitMapType;
  290.  
  291. struct ATLAPRec {
  292.     ABCallType abOpcode;
  293.     short abResult;
  294.     long abUserReference;
  295.     LAPAdrBlock lapAddress;
  296.     short lapReqCount;
  297.     short lapActCount;
  298.     Ptr lapDataPtr;
  299. };
  300.  
  301. typedef struct ATLAPRec ATLAPRec;
  302. typedef ATLAPRec *ATLAPRecPtr, **ATLAPRecHandle;
  303.  
  304. struct ATDDPRec {
  305.     ABCallType abOpcode;
  306.     short abResult;
  307.     long abUserReference;
  308.     short ddpType;
  309.     short ddpSocket;
  310.     AddrBlock ddpAddress;
  311.     short ddpReqCount;
  312.     short ddpActCount;
  313.     Ptr ddpDataPtr;
  314.     short ddpNodeID;
  315. };
  316.  
  317. typedef struct ATDDPRec ATDDPRec;
  318. typedef ATDDPRec *ATDDPRecPtr, **ATDDPRecHandle;
  319.  
  320. struct ATNBPRec {
  321.     ABCallType abOpcode;
  322.     short abResult;
  323.     long abUserReference;
  324.     EntityPtr nbpEntityPtr;
  325.     Ptr nbpBufPtr;
  326.     short nbpBufSize;
  327.     short nbpDataField;
  328.     AddrBlock nbpAddress;
  329.     RetransType nbpRetransmitInfo;
  330. };
  331.  
  332. typedef struct ATNBPRec ATNBPRec;
  333. typedef ATNBPRec *ATNBPRecPtr, **ATNBPRecHandle;
  334.  
  335. struct ATATPRec {
  336.     ABCallType abOpcode;
  337.     short abResult;
  338.     long abUserReference;
  339.     short atpSocket;
  340.     AddrBlock atpAddress;
  341.     short atpReqCount;
  342.     Ptr atpDataPtr;
  343.     BDSPtr atpRspBDSPtr;
  344.     BitMapType atpBitMap;
  345.     short atpTransID;
  346.     short atpActCount;
  347.     long atpUserData;
  348.     Boolean atpXO;
  349.     Boolean atpEOM;
  350.     short atpTimeOut;
  351.     short atpRetries;
  352.     short atpNumBufs;
  353.     short atpNumRsp;
  354.     short atpBDSSize;
  355.     long atpRspUData;
  356.     Ptr atpRspBuf;
  357.     short atpRspSize;
  358. };
  359.  
  360. typedef struct ATATPRec ATATPRec;
  361. typedef ATATPRec *ATATPRecPtr, **ATATPRecHandle;
  362.  
  363. typedef struct {
  364.     char cmdByte;
  365.     char startEndFlag;
  366.     short forkRefNum;
  367.     long rwOffset;
  368.     long reqCount;
  369.     char newLineFlag;
  370.     char newLineChar;
  371. }AFPCommandBlock;
  372.  
  373.  
  374. #define XPPPBHeader \
  375.     QElem *qLink;\
  376.     short qType;\
  377.     short ioTrap;\
  378.     Ptr ioCmdAddr;\
  379.     ProcPtr ioCompletion;\
  380.     OSErr ioResult;\
  381.     long cmdResult;\
  382.     short ioVRefNum;\
  383.     short ioRefNum;\
  384.     short csCode;
  385.  
  386. typedef struct {
  387.     XPPPBHeader
  388.     short sessRefnum;               /*Offset to session refnum*/
  389.     char aspTimeout;                /*Timeout for ATP*/
  390.     char aspRetry;                  /*Retry count for ATP*/
  391.     short cbSize;                   /*Command block size*/
  392.     Ptr cbPtr;                      /*Command block pointer*/
  393.     short rbSize;                   /*Reply buffer size*/
  394.     Ptr rbPtr;                      /*Reply buffer pointer*/
  395.     short wdSize;                   /*Write Data size*/
  396.     Ptr wdPtr;                      /*Write Data pointer*/
  397.     char ccbStart[296];             /*CCB memory allocated for driver afpWrite max size(CCB)=296 all other calls=150*/
  398. }XPPPrmBlk;
  399.  
  400.  
  401. typedef struct {
  402.     XPPPBHeader 
  403.     short sessRefnum;               /*Offset to session refnum */
  404.     char aspTimeout;                /*Timeout for ATP */
  405.     char aspRetry;                  /*Retry count for ATP */
  406.     short cbSize;                   /*Command block size */
  407.     Ptr cbPtr;                      /*Command block pointer */
  408.     short rbSize;                   /*Reply buffer size */
  409.     Ptr rbPtr;                      /*Reply buffer pointer */
  410.     AddrBlock afpAddrBlock;         /*block in AFP login */
  411.     Ptr afpSCBPtr;                  /*SCB pointer in AFP login */
  412.     Ptr afpAttnRoutine;             /*routine pointer in AFP login */
  413.     char ccbFill[144];              /*CCB memory allocated for driver  Login needs only 150 bytes BUT CCB really starts in the middle of AFPSCBPtr and also clobbers AFPAttnRoutine. */
  414. }AFPLoginPrm;
  415.  
  416.  
  417. typedef struct {
  418.     XPPPBHeader 
  419.     short sessRefnum;               /*Offset to session refnum */
  420.     char aspTimeout;                /*Timeout for ATP */
  421.     char aspRetry;                  /*Retry count for ATP */
  422.     AddrBlock serverAddr;           /*Server address block */
  423.     Ptr scbPointer;                 /*SCB pointer */
  424.     Ptr attnRoutine;                /*Attention routine pointer*/
  425. }ASPOpenPrm;
  426.  
  427. typedef ASPOpenPrm *ASPOpenPrmPtr;
  428.  
  429. typedef struct {
  430.     XPPPBHeader
  431.     Ptr abortSCBPtr;                /*SCB pointer for AbortOS */
  432. }ASPAbortPrm;
  433.  
  434.  
  435. typedef struct {
  436.     XPPPBHeader
  437.     short aspMaxCmdSize;            /*For SPGetParms*/
  438.     short aspQuantumSize;
  439.     short numSesss;
  440. }ASPGetparmsBlk;
  441.  
  442.  
  443. typedef struct {
  444.     XPPPBHeader 
  445.     short xppSubCode;
  446.     char xppTimeout;                /*retry interval (seconds)*/
  447.     char xppRetry;                  /*retry count*/
  448.     short filler1;
  449.     Ptr zipBuffPtr;                 /*pointer to buffer (must be 578 bytes)*/
  450.     short zipNumZones;              /*no. of zone names in this response*/
  451.     char zipLastFlag;               /*non-zero if no more zones*/
  452.     char filler2;                   /*filler*/
  453.     char zipInfoField[70];          /*on initial call, set first word to zero*/
  454. }XCallParam;
  455.  
  456.  
  457. typedef struct {
  458.     short entryLength;
  459.     Ptr entryPtr;
  460. }WDSElement;
  461.  
  462.  
  463. typedef struct {
  464.     AddrBlock nteAddress;           /*network address of entity*/
  465.     char filler;
  466.     char entityData[99];            /*Object, Type & Zone*/
  467. }NTElement;
  468.  
  469.  
  470. typedef struct {
  471.     Ptr qNext;                      /*ptr to next NTE*/
  472.     NTElement nt;
  473. }NamesTableEntry;
  474.  
  475.  
  476. #define MPPATPHeader \
  477.     QElem *qLink;                   /*next queue entry*/\
  478.     short qType;                    /*queue type*/\
  479.     short ioTrap;                   /*routine trap*/\
  480.     Ptr ioCmdAddr;                  /*routine address*/\
  481.     ProcPtr ioCompletion;           /*completion routine*/\
  482.     OSErr ioResult;                 /*result code*/\
  483.     long userData;                  /*Command result (ATP user bytes)*/\
  484.     short reqTID;                   /*request transaction ID*/\
  485.     short ioRefNum;                 /*driver reference number*/\
  486.     short csCode;                   /*Call command code*/
  487.  
  488. typedef struct {
  489.     MPPATPHeader
  490. }MPPparms;
  491.  
  492.  
  493. typedef struct {
  494.     MPPATPHeader 
  495.     char protType;                  /*ALAP protocol Type */
  496.     char filler;
  497.     union {
  498.         Ptr wdsPointer;             /*-> write data structure*/
  499.         Ptr handler;                /*-> protocol handler routine*/
  500.         } LAPptrs;
  501. }LAPparms;
  502.  
  503.  
  504. typedef struct {
  505.     MPPATPHeader 
  506.     char socket;                    /*socket number */
  507.     char checksumFlag;              /*check sum flag */
  508.     union {
  509.         Ptr wdsPointer;             /*-> write data structure*/
  510.         Ptr listener;               /*->write data structure or -> Listener*/
  511.         } DDPptrs;
  512. }DDPparms;
  513.  
  514.  
  515. typedef struct {
  516.     MPPATPHeader 
  517.     char interval;                  /*retry interval */
  518.     char count;                     /*retry count */
  519.     union {
  520.         Ptr ntQElPtr;
  521.         Ptr entityPtr;
  522.         } NBPPtrs;
  523.     union {
  524.         char verifyFlag;
  525.         struct {
  526.             Ptr retBuffPtr;
  527.             short retBuffSize;
  528.             short maxToGet;
  529.             short numGotten;
  530.             } Lookup;
  531.         struct {
  532.             AddrBlock confirmAddr;
  533.             char newSocket;
  534.             } Confirm;
  535.         } parm;
  536. }NBPparms;
  537.  
  538.  
  539. typedef struct {
  540.     MPPATPHeader 
  541.     char newSelfFlag;               /*self-send toggle flag */
  542.     char oldSelfFlag;               /*previous self-send state */
  543. }SetSelfparms;
  544.  
  545.  
  546. typedef struct {
  547.     MPPATPHeader
  548.     Ptr nKillQEl;                   /*ptr to i/o queue element to cancel */
  549. }NBPKillparms;
  550.  
  551.  
  552. typedef struct {
  553.     MPPATPHeader                    /*max. concurrent NBP requests*/
  554.     short version;                  /*requested info version*/
  555.     Ptr varsPtr;                    /*pointer to well known MPP vars*/
  556.     Ptr DCEPtr;                     /*pointer to MPP DCE*/
  557.     short portID;                   /*port number [0..7]*/
  558.     long configuration;             /*32-bit configuration word*/
  559.     short selfSend;                 /*non zero if SelfSend enabled*/
  560.     short netLo;                    /*low value of network range*/
  561.     short netHi;                    /*high value of network range*/
  562.     long ourAdd;                    /*our 24-bit AppleTalk address*/
  563.     long routerAddr;                /*24-bit address of (last) router*/
  564.     short numOfPHs;                 /*max. number of protocol handlers*/
  565.     short numOfSkts;                /*max. number of static sockets*/
  566.     short numNBPEs;                 /*max. concurrent NBP requests*/
  567.     Ptr nTQueue;                    /*pointer to registered name queue*/
  568.     short LAlength;                 /*length in bytes of data link addr*/
  569.     Ptr linkAddr;                   /*data link address returned*/
  570.     Ptr zoneName;                   /*zone name returned*/
  571. }GetAppleTalkInfoParm;
  572.  
  573.  
  574. typedef struct {
  575.     MPPATPHeader
  576.     Ptr appName;                    /*pointer to application name in buffer*/
  577. }ATalkClosePrepParm;
  578.  
  579.  
  580. typedef union {
  581.     MPPparms MPP;                   /*General MPP parms*/
  582.     LAPparms LAP;                   /*ALAP calls*/
  583.     DDPparms DDP;                   /*DDP calls*/
  584.     NBPparms NBP;                   /*NBP calls*/
  585.     SetSelfparms SETSELF ;
  586.     NBPKillparms NBPKILL ;
  587.     GetAppleTalkInfoParm GAIINFO;
  588.     ATalkClosePrepParm ATALKCLOSE;
  589. }MPPParamBlock;
  590.  
  591. typedef MPPParamBlock *MPPPBPtr;
  592.  
  593. #define MOREATPHeader \
  594.     char atpSocket;                 /*currbitmap for requests or ATP socket number*/\
  595.     char atpFlags;                  /*control information*/\
  596.     AddrBlock addrBlock;            /*source/dest. socket address*/\
  597.     short reqLength;                /*request/response length*/\
  598.     Ptr reqPointer;                 /*->request/response Data*/\
  599.     Ptr bdsPointer;                 /*->response BDS */
  600.  
  601.  
  602. typedef struct {
  603.     MPPATPHeader
  604.     MOREATPHeader
  605. }ATPparms;
  606.  
  607.  
  608. typedef struct {
  609.     MPPATPHeader 
  610.     MOREATPHeader 
  611.     char filler;                    /*numOfBuffs */
  612.     char timeOutVal;                /*timeout interval */
  613.     char numOfResps;                /*number of responses actually received */
  614.     char retryCount;                /*number of retries */
  615.     short intBuff;                  /*used internally for NSendRequest */
  616.     char TRelTime;
  617. }SendReqparms;
  618.  
  619.  
  620. typedef struct {
  621.     MPPATPHeader 
  622.     MOREATPHeader 
  623.     union {
  624.         char bitMap;                /*bitmap received */
  625.         char numOfBuffs;            /*number of responses being sent*/
  626.         char rspNum;                /*sequence number*/
  627.         } u0;
  628. }ATPmisc1;
  629.  
  630.  
  631. typedef struct {
  632.     MPPATPHeader 
  633.     MOREATPHeader 
  634.     char filler;
  635.     char bdsSize;                   /*number of BDS elements */
  636.     short transID;                  /*transaction ID recd. */
  637. }ATPmisc2;
  638.  
  639.  
  640. typedef struct {
  641.     MPPATPHeader
  642.     MOREATPHeader
  643.     Ptr aKillQEl;                   /*ptr to i/o queue element to cancel*/
  644. }Killparms;
  645.  
  646.  
  647. typedef union {
  648.     ATPparms ATP;                   /*General ATP parms*/
  649.     SendReqparms SREQ;              /*sendrequest parms*/
  650.     ATPmisc1 OTH1;                  /*and a few others*/
  651.     ATPmisc2 OTH2;                  /*and a few others*/
  652.     Killparms KILL;                 /*and a few others */
  653. }ATPParamBlock;
  654.  
  655. typedef ATPParamBlock *ATPPBPtr;
  656.  
  657. typedef union {
  658.     XPPPrmBlk XPP;
  659.     ASPGetparmsBlk GETPARM;
  660.     ASPAbortPrm ABORT;
  661.     ASPOpenPrm OPEN;
  662.     AFPLoginPrm LOGIN;
  663.     XCallParam XCALL;
  664. }XPPParamBlock;
  665.  
  666. typedef XPPParamBlock *XPPParmBlkPtr;
  667.  
  668.  
  669. #ifdef __cplusplus
  670. extern "C" {
  671. #endif
  672. pascal OSErr OpenXPP(short *xppRefnum); 
  673. pascal OSErr ASPOpenSession(ASPOpenPrmPtr thePBptr,Boolean async); 
  674. pascal OSErr ASPCloseSession(XPPParmBlkPtr thePBptr,Boolean async); 
  675. pascal OSErr ASPAbortOS(XPPParmBlkPtr thePBptr,Boolean async); 
  676. pascal OSErr ASPGetParms(XPPParmBlkPtr thePBptr,Boolean async); 
  677. pascal OSErr ASPCloseAll(XPPParmBlkPtr thePBptr,Boolean async); 
  678. pascal OSErr ASPUserWrite(XPPParmBlkPtr thePBptr,Boolean async); 
  679. pascal OSErr ASPUserCommand(XPPParmBlkPtr thePBptr,Boolean async); 
  680. pascal OSErr ASPGetStatus(XPPParmBlkPtr thePBptr,Boolean async); 
  681. pascal OSErr AFPCommand(XPPParmBlkPtr thePBptr,Boolean async); 
  682. pascal OSErr GetLocalZones(XPPParmBlkPtr thePBptr,Boolean async); 
  683. pascal OSErr GetZoneList(XPPParmBlkPtr thePBptr,Boolean async); 
  684. pascal OSErr GetMyZone(XPPParmBlkPtr thePBptr,Boolean async); 
  685. pascal OSErr PAttachPH(MPPPBPtr thePBptr,Boolean async); 
  686. pascal OSErr PDetachPH(MPPPBPtr thePBptr,Boolean async); 
  687. pascal OSErr PWriteLAP(MPPPBPtr thePBptr,Boolean async); 
  688. pascal OSErr POpenSkt(MPPPBPtr thePBptr,Boolean async); 
  689. pascal OSErr PCloseSkt(MPPPBPtr thePBptr,Boolean async); 
  690. pascal OSErr PWriteDDP(MPPPBPtr thePBptr,Boolean async); 
  691. pascal OSErr PRegisterName(MPPPBPtr thePBptr,Boolean async); 
  692. pascal OSErr PLookupName(MPPPBPtr thePBptr,Boolean async); 
  693. pascal OSErr PConfirmName(MPPPBPtr thePBptr,Boolean async); 
  694. pascal OSErr PRemoveName(MPPPBPtr thePBptr,Boolean async); 
  695. pascal OSErr PSetSelfSend(MPPPBPtr thePBptr,Boolean async); 
  696. pascal OSErr PKillNBP(MPPPBPtr thePBptr,Boolean async); 
  697. pascal OSErr PGetAppleTalkInfo(MPPPBPtr thePBptr,Boolean async); 
  698. pascal OSErr PATalkClosePrep(MPPPBPtr thePBptr,Boolean async); 
  699. pascal OSErr POpenATPSkt(ATPPBPtr thePBptr,Boolean async); 
  700. pascal OSErr PCloseATPSkt(ATPPBPtr thePBPtr,Boolean async); 
  701. pascal OSErr PSendRequest(ATPPBPtr thePBPtr,Boolean async); 
  702. pascal OSErr PGetRequest(ATPPBPtr thePBPtr,Boolean async); 
  703. pascal OSErr PSendResponse(ATPPBPtr thePBPtr,Boolean async); 
  704. pascal OSErr PAddResponse(ATPPBPtr thePBPtr,Boolean async); 
  705. pascal OSErr PRelTCB(ATPPBPtr thePBPtr,Boolean async); 
  706. pascal OSErr PRelRspCB(ATPPBPtr thePBPtr,Boolean async); 
  707. pascal OSErr PNSendRequest(ATPPBPtr thePBPtr,Boolean async); 
  708. pascal OSErr PKillSendReq(ATPPBPtr thePBPtr,Boolean async); 
  709. pascal OSErr PKillGetReq(ATPPBPtr thePBPtr,Boolean async); 
  710. pascal OSErr ATPKillAllGetReq(ATPPBPtr thePBPtr,Boolean async); 
  711. pascal void BuildLAPwds(Ptr wdsPtr,Ptr dataPtr,short destHost,short prototype,
  712.     short frameLen); 
  713. pascal void BuildDDPwds(Ptr wdsPtr,Ptr headerPtr,Ptr dataPtr,const AddrBlock netAddr,
  714.     short ddpType,short dataLen); 
  715. pascal void NBPSetEntity(Ptr buffer,Ptr nbpObject,Ptr nbpType,Ptr nbpZone); 
  716. pascal void NBPSetNTE(Ptr ntePtr,Ptr nbpObject,Ptr nbpType,Ptr nbpZone,
  717.     short socket); 
  718. pascal short GetBridgeAddress(void); 
  719. pascal short BuildBDS(Ptr buffPtr,Ptr bdsPtr,short buffSize); 
  720. pascal OSErr MPPOpen(void); 
  721. pascal OSErr MPPClose(void); 
  722. pascal OSErr LAPOpenProtocol(ABByte theLAPType,Ptr protoPtr); 
  723. pascal OSErr LAPCloseProtocol(ABByte theLAPType); 
  724. pascal OSErr LAPWrite(ATLAPRecHandle abRecord,Boolean async); 
  725. pascal OSErr LAPRead(ATLAPRecHandle abRecord,Boolean async); 
  726. pascal OSErr LAPRdCancel(ATLAPRecHandle abRecord); 
  727. pascal OSErr LAPAddATQ(ATQEntryPtr theATQEntry); 
  728. pascal OSErr LAPRmvATQ(ATQEntryPtr theATQEntry); 
  729. pascal OSErr DDPOpenSocket(short *theSocket,Ptr sktListener); 
  730. pascal OSErr DDPCloseSocket(short theSocket); 
  731. pascal OSErr DDPRead(ATDDPRecHandle abRecord,Boolean retCksumErrs,Boolean async); 
  732. pascal OSErr DDPWrite(ATDDPRecHandle abRecord,Boolean doChecksum,Boolean async); 
  733. pascal OSErr DDPRdCancel(ATDDPRecHandle abRecord); 
  734. pascal OSErr ATPLoad(void); 
  735. pascal OSErr ATPUnload(void); 
  736. pascal OSErr ATPOpenSocket(AddrBlock addrRcvd,short *atpSocket); 
  737. pascal OSErr ATPCloseSocket(short atpSocket); 
  738. pascal OSErr ATPSndRequest(ATATPRecHandle abRecord,Boolean async); 
  739. pascal OSErr ATPRequest(ATATPRecHandle abRecord,Boolean async); 
  740. pascal OSErr ATPReqCancel(ATATPRecHandle abRecord,Boolean async); 
  741. pascal OSErr ATPGetRequest(ATATPRecHandle abRecord,Boolean async); 
  742. pascal OSErr ATPSndRsp(ATATPRecHandle abRecord,Boolean async); 
  743. pascal OSErr ATPAddRsp(ATATPRecHandle abRecord); 
  744. pascal OSErr ATPResponse(ATATPRecHandle abRecord,Boolean async); 
  745. pascal OSErr ATPRspCancel(ATATPRecHandle abRecord,Boolean async); 
  746. pascal OSErr NBPRegister(ATNBPRecHandle abRecord,Boolean async); 
  747. pascal OSErr NBPLookup(ATNBPRecHandle abRecord,Boolean async); 
  748. pascal OSErr NBPExtract(Ptr theBuffer,short numInBuf,short whichOne,EntityName *abEntity,
  749.     AddrBlock *address); 
  750. pascal OSErr NBPConfirm(ATNBPRecHandle abRecord,Boolean async); 
  751. pascal OSErr NBPRemove(EntityPtr abEntity); 
  752. pascal OSErr NBPLoad(void); 
  753. pascal OSErr NBPUnload(void); 
  754. pascal OSErr GetNodeAddress(short *myNode,short *myNet); 
  755. pascal Boolean IsMPPOpen(void); 
  756. pascal Boolean IsATPOpen(void); 
  757. pascal void ATEvent(long event,Ptr infoPtr); 
  758. pascal OSErr ATPreFlightEvent(long event,long cancel,Ptr infoPtr); 
  759. #ifdef __cplusplus
  760. }
  761. #endif
  762.  
  763. #endif
  764.